package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.hibernate.validator.constraints.Length;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class EditSubmissionMessage {
    @TargetAggregateIdentifier
    private final String username;
    private final int submissionId;

    private final String newMessage;

    public EditSubmissionMessage(String username, int submissionId, String newMessage) {
        this.username = username;
        this.submissionId = submissionId;
        this.newMessage = newMessage;
    }

    @UrlIdentifier @NotNull
    public String getUsername() {
        return username;
    }

    @Min(1)
    public int getSubmissionId() {
        return submissionId;
    }

    @Length(max = 4096) @NotNull
    public String getNewMessage() {
        return newMessage;
    }
}
